package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;

import java.util.Objects;

public enum OssBasePathEnum implements IEnum<String> {
    staticFile(  "static", "静态文件"),
    agreementPDF("agreement", "存放协议路径"),
    userCert(    "userCert", "存放用户认证信息路径"),
    userFeedback("userFeedback", "用户反馈图片路径"),
    merchantFeedback("merchantFeedback", "商家反馈图片路径"),
    fileStorage("file-storage", "文件仓库,存放素材和商品图片"),
    activity(   "activity", "存放营销模块图片"),
    guide(      "guide", "导购图片"),
    orderEvidence("order-evidence", "订单存证"),
    merchant(   "merchant", "商家信息"),
    ;

    private String path;

    private String name;

    OssBasePathEnum(String path, String name) {
        this.path = path;
        this.name = name;
    }

    @Override
    public String value() {
        return this.path;
    }

    @Override
    public String named() {
        return this.name;
    }

    public static String getName(String path) {
        for (OssBasePathEnum thisEnum : OssBasePathEnum.values()) {
            if (Objects.equals(thisEnum.path, path)) {
                return thisEnum.name;
            }
        }
        return "";
    }
}
